import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    playlist:[
      //初始化的时候可以给它一点数据
      {
        name:"盛唐夜唱",
        id:29004480,
        al:{
          name:"热门华语232",
          picUrl:'http://p4.music.126.net/cpoUinrExafBHL5Nv5iDHQ==/109951166361218466.jpg'
        }
      }
    ],//播放列表
    playCurrentIndex:0,//索引值
	user:{
		isLogin:false,
		userinfo:"未登录"
	}
	
  },
  mutations: {
    setPlayList:function(state,value){
      state.playlist=value
    },
	setPlayIndex(state,value){
		state.playCurrentIndex=value
	},
	setUser:function(state,value){
		// state.user=vlaue;
		console.log(value);
		console.log(value.nickname);
	}
  },
  actions: {
	  async phoneLogin(content,payload){
		  console.log(payload);
		  
	  }
  },
  modules: {
  }
})
